import { request } from "@/request";

//注册用户
export const register = (params: API.login) =>
  request({
    method: "POST",
    url: "/user/register",
    data: params,
  });

//登录
export const login = (params: API.register) =>
  request({
    method: "POST",
    url: "/user/login",
    data: params,
  });

//退出登录
export const loginOut = () =>
  request({
    method: "POST",
    url: "/user/logout",
  });

//获取用户信息
export const getUserInfo = () =>
  request<API.UserInfo>({
    method: "GET",
    url: "/user/info",
  });


//修改用户信息
export const updateUserInfo = (params: API.UserInfo) =>
  request({
    method: "PUT",
    url: "/user/update",
    data: params,
  });